Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODDraft


CreatePart

The CreatePart method creates a new part in this draft.

ODPart CreatePart (in ODType partType, 
                   in ODEditor optionalEditor);
partType
The part kind for the new part, or kODNULL if you will set the part kind later.
optionalEditor
The part editor to be used if the normal binding fails, or kODNoEditor if you choose not to specify an editor.
return value
A reference to the newly created part object.
DISCUSSION
You can call this method only if this draft's current permissions provide write access.

This method calls the new part's InitPart method to initialize the part object.

This method initializes the reference count of the returned part. When you have finished using that part, you should call its Release method.

If this method executes successfully, it marks this draft as dirty.

EXCEPTIONS
kODErrCannotCreatePart
Cannot create the specified part object.
SEE ALSO
The ODType type (page 876).
The ODEditor type (page 929).
The ODDraft::AcquirePart method (page 156).
The ODPart::InitPart method (page 529).
The ODPart class (page 459).
"Using a Tool Palette to Embed Parts" on page 239 in OpenDoc Programmer's Guide.
"Creating a New Document" on page 292 in OpenDoc Programmer's Guide.
"The InitPart Method" on page 294 in OpenDoc Programmer's Guide.
"Adding an Embedded Part" on page 305 in OpenDoc Programmer's Guide.
Table 11-1 on page 466 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help